from flask import jsonify, Blueprint, redirect


api_index = Blueprint('api', __name__)
api_index.url_prefix = "/api"


@api_index.route('/')
def index():
    json='{"key":"value"}'
    return json

@api_index.route('/test')
def test():
    tasks = [
        {
            'id': 1,
            'title': u'订阅 python_mastery 专栏',
            'description': u'专栏Link： https://xiaozhuanlan.com/python_mastery'
        },
        {
            'id': 2,
            'title': u'订阅 pythonml 专栏',
            'description': u'专栏Link： https://xiaozhuanlan.com/pythonml'
        }
    ]
    return jsonify(tasks)